package com.itheima.domain;

import java.time.LocalDate;


public class Student implements Comparable<Student> {
    private String id;
    private String name;
    private String gender;
    private String classes;
    private int group;
    private String phone;
    private LocalDate birthday;
    private int age;

    public Student() {
    }

    public Student(String id, String name, String gender, String classes, int group, String phone, LocalDate birthday, int age) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.classes = classes;
        this.group = group;
        this.phone = phone;
        this.birthday = birthday;
        this.age = age;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getClasses() {
        return classes;
    }

    public void setClasses(String classes) {
        this.classes = classes;
    }

    public int getGroup() {
        return group;
    }

    public void setGroup(int group) {
        this.group = group;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public LocalDate getBirthday() {
        return birthday;
    }

    public void setBirthday(LocalDate birthday) {
        this.birthday = birthday;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", classes='" + classes + '\'' +
                ", group=" + group +
                ", phone='" + phone + '\'' +
                ", birthday=" + birthday +
                ", age=" + age +
                '}';
    }

    @Override
    public int compareTo(Student o) {
        return this.birthday.compareTo(o.birthday) == 0 ? this.name.compareTo(o.name) : this.birthday.compareTo(o.birthday);
    }
}
